#include "jo_browser.h"
#include "jo_login.h"

IMPLEMENT_APP(jo_browser);

jo_browser::jo_browser()
{
    m_login_dlg = NULL;
    m_explorer_frame = NULL;
}

jo_browser::~jo_browser()
{

}

bool jo_browser::OnInit()
{
    wxImage::AddHandler(new wxICOHandler);
    wxImage::AddHandler(new wxPNGHandler);
    m_login_dlg = new CLoginDlg(NULL, _("Login"));
    return true;
}

int jo_browser::OnRun()
{
    int i_code = m_login_dlg->ShowModal();
    if (i_code == wxID_OK)
    {
        //m_explorer_frame = new CExplorerFrame(NULL, _("Jo_Explorer"), this);
        //m_explorer_frame->Show();
        //m_explorer_frame->Center();
        //m_explorer_frame->Maximize(true);
        //m_explorer_frame->ShowFullScreen(true);

        MainLoop();
    }
    m_login_dlg->Destroy();
    delete m_login_dlg;
    m_login_dlg = NULL;

    return 0;
}


int jo_browser::OnExit()
{
    if (m_explorer_frame)
    {
        delete m_explorer_frame;
        m_explorer_frame = NULL;
    }

    return 0;
}
